extends markdown

global !p

verbose = {
	"def": "define",
	"ref": "refer"
}

endglobal

snippet "=" "First heading" b
= ${1:`!v  expand('%:t:r')`} =
$0
endsnippet

snippet "=([1-6])" "Headings" rb
`!p snip.rv = '=' * int(match.group(1)) ` ${1:${VISUAL}} `!p snip.rv = '=' * int(match.group(1))`
$0
endsnippet

# pre defined attributes: def and ref
# refer block will auto update while define block changed
snippet "(def|ref)" "define, refer" riw
<!-- !${1:`!p snip.rv = verbose[match.group(1)]`}${2:/${3:values}}! -->
${4:${VISUAL}}
<!-- !END/$1! -->$0
endsnippet

# customed attributions
snippet attr "customed attributions" iw
<!-- !${1:name}${2:/${3:values}}! -->
${4:${VISUAL}}
<!-- !END/$1! -->$0
endsnippet

# equal to !tags/tag1,tag2,...!
snippet tags "tags" iw
<!-- :${1:${VISUAL}}: -->$0
endsnippet



# snippet end "end of sections" iw
# <!-- !END! -->$0
# endsnippet
